<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>LibCDS: /home/zsshen/Desktop/git-hub-code/C-Common-Data-Structures/include/container/tree_map.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">LibCDS
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('tree__map_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">tree_map.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The ordered map to store key value pairs.  
<a href="#details">More...</a></p>

<p><a href="tree__map_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structTreeMap.html">TreeMap</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The implementation for ordered map.  <a href="structTreeMap.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a6f6e4f4df6632fdbf3d1075f51af07af"><td class="memItemLeft" align="right" valign="top">typedef struct _TreeMapData&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a6f6e4f4df6632fdbf3d1075f51af07af">TreeMapData</a></td></tr>
<tr class="memdesc:a6f6e4f4df6632fdbf3d1075f51af07af"><td class="mdescLeft">&#160;</td><td class="mdescRight">TreeMapData is the data type for the container private information.  <a href="#a6f6e4f4df6632fdbf3d1075f51af07af">More...</a><br/></td></tr>
<tr class="separator:a6f6e4f4df6632fdbf3d1075f51af07af"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aced0f18cb2d47f0e358984795be3df8a"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#aced0f18cb2d47f0e358984795be3df8a">TreeMapInit</a> (<a class="el" href="structTreeMap.html">TreeMap</a> **ppObj)</td></tr>
<tr class="memdesc:aced0f18cb2d47f0e358984795be3df8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The constructor for <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a>.  <a href="#aced0f18cb2d47f0e358984795be3df8a">More...</a><br/></td></tr>
<tr class="separator:aced0f18cb2d47f0e358984795be3df8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a296d5303b6e02526e36542afdce932d7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a296d5303b6e02526e36542afdce932d7">TreeMapDeinit</a> (<a class="el" href="structTreeMap.html">TreeMap</a> **ppObj)</td></tr>
<tr class="memdesc:a296d5303b6e02526e36542afdce932d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">The destructor for <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a>.  <a href="#a296d5303b6e02526e36542afdce932d7">More...</a><br/></td></tr>
<tr class="separator:a296d5303b6e02526e36542afdce932d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cb91b8efa436584df1dcd9418113e5c"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a2cb91b8efa436584df1dcd9418113e5c">TreeMapPut</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Pair *pPair)</td></tr>
<tr class="memdesc:a2cb91b8efa436584df1dcd9418113e5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a key value pair into the map.  <a href="#a2cb91b8efa436584df1dcd9418113e5c">More...</a><br/></td></tr>
<tr class="separator:a2cb91b8efa436584df1dcd9418113e5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afac99f9692e4189b452dbc39bd086ee4"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#afac99f9692e4189b452dbc39bd086ee4">TreeMapGet</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Key key, Value *pValue)</td></tr>
<tr class="memdesc:afac99f9692e4189b452dbc39bd086ee4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the value corresponding to the designated key.  <a href="#afac99f9692e4189b452dbc39bd086ee4">More...</a><br/></td></tr>
<tr class="separator:afac99f9692e4189b452dbc39bd086ee4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0625e6795079093de1d082d86398413"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#ac0625e6795079093de1d082d86398413">TreeMapFind</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Key key)</td></tr>
<tr class="memdesc:ac0625e6795079093de1d082d86398413"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the map contains the designated key.  <a href="#ac0625e6795079093de1d082d86398413">More...</a><br/></td></tr>
<tr class="separator:ac0625e6795079093de1d082d86398413"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b0e88042bb8fba059416422ebf0d6ab"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a1b0e88042bb8fba059416422ebf0d6ab">TreeMapRemove</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Key key)</td></tr>
<tr class="memdesc:a1b0e88042bb8fba059416422ebf0d6ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete the key value pair corresponding to the designated key.  <a href="#a1b0e88042bb8fba059416422ebf0d6ab">More...</a><br/></td></tr>
<tr class="separator:a1b0e88042bb8fba059416422ebf0d6ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72b723785ef79b537b3305a9c9244099"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a72b723785ef79b537b3305a9c9244099">TreeMapSize</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self)</td></tr>
<tr class="memdesc:a72b723785ef79b537b3305a9c9244099"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of stored key value pairs.  <a href="#a72b723785ef79b537b3305a9c9244099">More...</a><br/></td></tr>
<tr class="separator:a72b723785ef79b537b3305a9c9244099"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27eff230144c1b126c4851b12b195331"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a27eff230144c1b126c4851b12b195331">TreeMapMinimum</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Pair **ppPair)</td></tr>
<tr class="memdesc:a27eff230144c1b126c4851b12b195331"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the key value pair with the minimum order from the map.  <a href="#a27eff230144c1b126c4851b12b195331">More...</a><br/></td></tr>
<tr class="separator:a27eff230144c1b126c4851b12b195331"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a534d5b9030b8f20f365fa911843f56a0"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a534d5b9030b8f20f365fa911843f56a0">TreeMapMaximum</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Pair **ppPair)</td></tr>
<tr class="memdesc:a534d5b9030b8f20f365fa911843f56a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the key value pair with the maximum order from the map.  <a href="#a534d5b9030b8f20f365fa911843f56a0">More...</a><br/></td></tr>
<tr class="separator:a534d5b9030b8f20f365fa911843f56a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a400b43cf750c51cb02fd284bf5f45698"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a400b43cf750c51cb02fd284bf5f45698">TreeMapPredecessor</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Key key, Pair **ppPair)</td></tr>
<tr class="memdesc:a400b43cf750c51cb02fd284bf5f45698"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the key value pair which is the predecessor of the given key.  <a href="#a400b43cf750c51cb02fd284bf5f45698">More...</a><br/></td></tr>
<tr class="separator:a400b43cf750c51cb02fd284bf5f45698"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54d38e9eae8308b8fb0d4c0469520b91"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a54d38e9eae8308b8fb0d4c0469520b91">TreeMapSuccessor</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, Key key, Pair **ppPair)</td></tr>
<tr class="memdesc:a54d38e9eae8308b8fb0d4c0469520b91"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the key value pair which is the successor of the given key.  <a href="#a54d38e9eae8308b8fb0d4c0469520b91">More...</a><br/></td></tr>
<tr class="separator:a54d38e9eae8308b8fb0d4c0469520b91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2982b98fafa5703c7220478bd0d29bcf"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a2982b98fafa5703c7220478bd0d29bcf">TreeMapIterate</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, bool bReset, Pair **ppPair)</td></tr>
<tr class="memdesc:a2982b98fafa5703c7220478bd0d29bcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterate through the map from the minimum order to the maximum order.  <a href="#a2982b98fafa5703c7220478bd0d29bcf">More...</a><br/></td></tr>
<tr class="separator:a2982b98fafa5703c7220478bd0d29bcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91cb4be6a5e7e775d66b9a536463db87"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#a91cb4be6a5e7e775d66b9a536463db87">TreeMapReverseIterate</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, bool bReset, Pair **ppPair)</td></tr>
<tr class="memdesc:a91cb4be6a5e7e775d66b9a536463db87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reversely iterate through the map from the minimum order to the maximum order.  <a href="#a91cb4be6a5e7e775d66b9a536463db87">More...</a><br/></td></tr>
<tr class="separator:a91cb4be6a5e7e775d66b9a536463db87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab744090c91ce404e0f4853599ecf3649"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#ab744090c91ce404e0f4853599ecf3649">TreeMapSetCompare</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, int32_t(*pFunc)(Key, Key))</td></tr>
<tr class="memdesc:ab744090c91ce404e0f4853599ecf3649"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the custom key comparison method.  <a href="#ab744090c91ce404e0f4853599ecf3649">More...</a><br/></td></tr>
<tr class="separator:ab744090c91ce404e0f4853599ecf3649"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3385c339bc1eb4047d0d7af472febec"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tree__map_8h.html#ab3385c339bc1eb4047d0d7af472febec">TreeMapSetDestroy</a> (<a class="el" href="structTreeMap.html">TreeMap</a> *self, void(*pFunc)(Pair *))</td></tr>
<tr class="memdesc:ab3385c339bc1eb4047d0d7af472febec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the custom key value pair resource clean method.  <a href="#ab3385c339bc1eb4047d0d7af472febec">More...</a><br/></td></tr>
<tr class="separator:ab3385c339bc1eb4047d0d7af472febec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The ordered map to store key value pairs. </p>

<p>Definition in file <a class="el" href="tree__map_8h_source.html">tree_map.h</a>.</p>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a6f6e4f4df6632fdbf3d1075f51af07af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct _TreeMapData <a class="el" href="tree__map_8h.html#a6f6e4f4df6632fdbf3d1075f51af07af">TreeMapData</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TreeMapData is the data type for the container private information. </p>

<p>Definition at line <a class="el" href="tree__map_8h_source.html#l00011">11</a> of file <a class="el" href="tree__map_8h_source.html">tree_map.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aced0f18cb2d47f0e358984795be3df8a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> **&#160;</td>
          <td class="paramname"><em>ppObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The constructor for <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ppObj</td><td>The double pointer to the to be constructed map</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOMEM</td><td>Insufficient memory for map construction </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a296d5303b6e02526e36542afdce932d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TreeMapDeinit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> **&#160;</td>
          <td class="paramname"><em>ppObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The destructor for <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a>. </p>
<p>If the custom resource clean method is set, it also runs the clean method for each pair.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ppObj</td><td>The double pointer to the to be destructed map </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2cb91b8efa436584df1dcd9418113e5c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapPut </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair *&#160;</td>
          <td class="paramname"><em>pPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insert a key value pair into the map. </p>
<p>This function inserts a key value pair into the map. If the order of the designated pair is the same with a certain one stored in the map, that pair will be replaced. Also, if the custom resource clean method is set, it runs the clean method for the replaced pair.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">pPair</td><td>The pointer to the designated pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_NOMEM</td><td>Insufficient memory for map extension </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afac99f9692e4189b452dbc39bd086ee4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapGet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Key&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Value *&#160;</td>
          <td class="paramname"><em>pValue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the value corresponding to the designated key. </p>
<p>This function retrieves the value corresponding to the designated key from the map. If the key can be found, the value will be returned by the third parameter. Otherwise, the error code in returned and the third parameter is updated with NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">key</td><td>The designated key </td></tr>
    <tr><td class="paramname">pValue</td><td>The pointer to the returned value</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_NODATA</td><td>No map entry can be found </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac0625e6795079093de1d082d86398413"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapFind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Key&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if the map contains the designated key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">key</td><td>The designated key</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td>The key can be found </td></tr>
    <tr><td class="paramname">NOKEY</td><td>The key cannot be found </td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1b0e88042bb8fba059416422ebf0d6ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapRemove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Key&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete the key value pair corresponding to the designated key. </p>
<p>This function deletes the key value pair corresponding to the designated key. If the custom resource clean method is set, it runs the clean methods for the deleted pair.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">key</td><td>The designated key</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_NODATA</td><td>No map entry can be found </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a72b723785ef79b537b3305a9c9244099"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapSize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the number of stored key value pairs. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of stored pairs </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a27eff230144c1b126c4851b12b195331"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapMinimum </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the key value pair with the minimum order from the map. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_IDX</td><td>Empty map </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a534d5b9030b8f20f365fa911843f56a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapMaximum </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the key value pair with the maximum order from the map. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_IDX</td><td>Empty map </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a400b43cf750c51cb02fd284bf5f45698"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapPredecessor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Key&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the key value pair which is the predecessor of the given key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">key</td><td>The designated key </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_NODATA</td><td>Non-existent immediate predecessor </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a54d38e9eae8308b8fb0d4c0469520b91"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapSuccessor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Key&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the key value pair which is the successor of the given key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">key</td><td>The designated key </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_NODATA</td><td>Non-existent immediate successor </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2982b98fafa5703c7220478bd0d29bcf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapIterate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bReset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Iterate through the map from the minimum order to the maximum order. </p>
<p>Before iterating through the map, it is necessary to pass:</p>
<ul>
<li>bReset = true</li>
<li>pPair = NULL for iterator initialization.</li>
</ul>
<p>After initialization, you can pass:</p>
<ul>
<li>bReset = false</li>
<li>pPair = the pointer to get the returned pair at each iteration.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">bReset</td><td>The knob to restart the iteration </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td>Iterator initialized successfully </td></tr>
    <tr><td class="paramname">CONTINUE</td><td>Iteration in progress </td></tr>
    <tr><td class="paramname">END</td><td>Iteration terminiated </td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a91cb4be6a5e7e775d66b9a536463db87"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapReverseIterate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bReset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Pair **&#160;</td>
          <td class="paramname"><em>ppPair</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reversely iterate through the map from the minimum order to the maximum order. </p>
<p>Before iterating through the map, it is necessary to pass:</p>
<ul>
<li>bReset = true</li>
<li>pPair = NULL for iterator initialization.</li>
</ul>
<p>After initialization, you can pass:</p>
<ul>
<li>bReset = false</li>
<li>pPair = the pointer to get the returned pair at each iteration.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">bReset</td><td>The knob to restart the iteration </td></tr>
    <tr><td class="paramname">ppPair</td><td>The double pointer to the returned pair</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td>Iterator initialized successfully </td></tr>
    <tr><td class="paramname">CONTINUE</td><td>Iteration in progress </td></tr>
    <tr><td class="paramname">END</td><td>Iteration terminiated </td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
    <tr><td class="paramname">ERR_GET</td><td>Invalid parameter to store returned pair </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab744090c91ce404e0f4853599ecf3649"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapSetCompare </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t(*)(Key, Key)&#160;</td>
          <td class="paramname"><em>pFunc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the custom key comparison method. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">pFunc</td><td>The function pointer to the custom method</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab3385c339bc1eb4047d0d7af472febec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TreeMapSetDestroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structTreeMap.html">TreeMap</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(Pair *)&#160;</td>
          <td class="paramname"><em>pFunc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the custom key value pair resource clean method. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The pointer to <a class="el" href="structTreeMap.html" title="The implementation for ordered map. ">TreeMap</a> structure </td></tr>
    <tr><td class="paramname">pFunc</td><td>The function pointer to the custom method</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCC</td><td></td></tr>
    <tr><td class="paramname">ERR_NOINIT</td><td>Uninitialized container </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e0f5f6345e438c73b9ae78ec2940718c.html">container</a></li><li class="navelem"><a class="el" href="tree__map_8h.html">tree_map.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
